import request from '@/utils/request';

export const loginIn = (data) =>
  request({
    url: "cashier/login",
    method: "post",
    data,
  });

export const categoryList = (data) =>
  request({
    url: "category/lists",
    method: "post",
    data,
  });

  export const goodsList = (data) =>
    request({
      url: "goods/lists",
      method: "post",
      data,
    });

    export const historyPrice = (data) =>
      request({
        url: "goods/historyPrice",
        method: "post",
        data,
      });

      export const searcheShouyinMember = (data) =>
        request({
          url: "member/searcheShouyinMember",
          method: "post",
          data,
        });

        export const addmj = (data) =>
          request({
            url: "order/addMaijiaCar",
            method: "post",
            data,
          });

          export const addmjPeople = (data) =>
            request({
              url: "order/addmj",
              method: "post",
              data,
            });

          export const getMaijiaCar = (data) =>
            request({
              url: "order/getMaijiaCar",
              method: "post",
              data,
            });

            export const getDataCar = (data) =>
              request({
                url: "order/dataCar",
                method: "post",
                data,
              });

              export const formatData = (data) =>
                request({
                  url: "batch/formatData",
                  method: "post",
                  data,
                });


      


export const addUser = (data) => {
  return request({
    url: "user/add",
    method: "post",
    data,
  });
}

export const updateUser = (id, data) => {
  return request({
    url: `user/${id}`,
    method: "put",
    data,
  });
}

export const deleteUser = (id) => {
  return request({
    url: `user/${id}`,
    method: "delete",
    data: {}
  });
}
